package org.light.simpleauth.verb;

import java.util.ArrayList;
import java.util.List;

import org.light.core.Verb;
import org.light.core.Writeable;
import org.light.domain.Domain;
import org.light.domain.JavascriptBlock;
import org.light.domain.JavascriptMethod;
import org.light.domain.Method;
import org.light.domain.Signature;
import org.light.domain.Statement;
import org.light.domain.Type;
import org.light.easyui.EasyUIPositions;
import org.light.exception.ValidateException;
import org.light.utils.WriteableUtil;

public class CountSaltUser extends Verb implements EasyUIPositions {
	@Override
	public Method generateDaoImplMethod() throws Exception {
		if (this.denied) return null;
		else {
			Method method = new Method();
			method.setStandardName("CountSalt");		
			method.addSignature(new Signature(1, "&self",""));
			method.addSignature(new Signature(2, "salt", "String"));
			method.setReturnType(new Type("Result<CountNum, Error>"));
			
			List<Writeable> sList = new ArrayList<Writeable>();
			method.setMethodStatementList(WriteableUtil.merge(sList));
			return method;
		}
	}

	@Override
	public Method generateDaoMethodDefinition() throws Exception {
		return null;
	}
	@Override
	public Method generateServiceMethodDefinition() throws Exception {
		return null;		
	}
	@Override
	public Method generateServiceImplMethod() throws Exception  {
		return null;
	}
	
	public CountSaltUser(Domain domain,String dbType) throws ValidateException{
		super();
		this.domain = domain;
		this.dbType = dbType;
		this.setVerbName("CountSalt");
		this.setLabel("盐计数");
		if  (domain.getLanguage().equalsIgnoreCase("english"))  this.setLabel("Count Salt");
	}

	@Override
	public JavascriptBlock generateEasyUIJSButtonBlock() throws Exception {
		return null;
	}

	@Override
	public JavascriptMethod generateEasyUIJSActionMethod() throws Exception {
		return null;	
	}

	@Override
	public Method generateDummyDaoImplMethod() throws Exception {
		if (this.denied) return null;
		else {
			Method method = new Method();
			method.setStandardName("CountSalt");		
			method.addSignature(new Signature(1, "&self",""));
			method.addSignature(new Signature(2, "salt", "String"));
			method.setReturnType(new Type("Result<CountNum, Error>"));
			
			List<Writeable> sList = new ArrayList<Writeable>();
			long serial = 1000L;

			method.setMethodStatementList(WriteableUtil.merge(sList));
			return method;
		}
	}

	@Override
	public Method generateControllerMethod() throws Exception {
		return null;
	}

	@Override
	public Method generateDummyServiceImplMethod() throws Exception {
		return null;
	}

	@Override
	public Method generateDummyDaoMethodDefinition() throws Exception {
		// TODO Auto-generated method stub
		return null;
	}
}
